<%@ page import="db.DBConnection" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%  Cookie[] cookies = request.getCookies();
    DBConnection dbConnection = new DBConnection();
    int id = -1;
    String secret = "";
    for (Cookie cookie : cookies) {
        if (cookie.getName().equals("user_id")) {
            id = Integer.parseInt(cookie.getValue());
        } else if (cookie.getName().equals("secret")) {
            secret = cookie.getValue();
        }
    }
    dbConnection.logout(id, secret);
    String redirectURL = "index.jsp";
    response.sendRedirect(redirectURL);
%>
<%--
  Created by IntelliJ IDEA.
  User: SLeeP
  Date: 08.05.12
  Time: 2:54
  To change this template use File | Settings | File Templates.
--%>
